import request from '@/utils/request'

// 获取城市列表
export function fetchCityList() {
  return request({
    url: '/order/customer/city/list',
    method: 'get'
  })
}

// 获取区域列表
export function fetchRegionList() {
  return request({
    url: '/order/customer/region/list',
    method: 'get'
  })
}

// 获取当前用户税务局列表
export function fetchCustomerTaxBureauList() {
  return request({
    url: '/order/customer/burea/citycode/list',
    method: 'get'
  })
}

// 获取分类完整分类列表
export function fetchClassifyListAll() {
  return request({
    url: '/order/customer/classify/all/list',
    method: 'get'
  })
}

// 获取代账机构列表
export function fetchAgencyList() {
  return request({
    url: '/order/customer/dzjg/list',
    method: 'get'
  })
}

// 获取客户经理列表
export function fetchManagerList() {
  return request({
    url: '/system/user/getKhjlList',
    method: 'get'
  })
}

// 获取企业客户下拉列表
export function customerListSelect(params) {
  return request({
    url: '/order/customer/list/select',
    method: 'get',
    params
  })
}

// 企业新增
export function createCompany(data) {
  return request({
    url: '/order/customer/add',
    method: 'post',
    data
  })
}

// 企业修改
export function updateCompany(data) {
  return request({
    url: '/order/customer/update',
    method: 'post',
    data
  })
}

// 获取企业客户详情
export function fetchCustomerDetail(id) {
  return request({
    url: '/order/customer/detail',
    method: 'get',
    params: { cus_id: id }
  })
}

// 获取客户iD
export function fetchCustomerID() {
  return request({
    url: '/order/customer/id',
    method: 'get'
  })
}

// 获取分类列表
export function fetchClassifyList(params) {
  return request({
    url: '/order/customer/classify/list',
    method: 'get',
    params
  })
}

// 文件上传
export function fileUpload(data) {
  return request({
    url: '/file/upload',
    method: 'post',
    data
  })
}

// 文件获取
export function fetchFile(param) {
  return request({
    url: '/common/download/resource',
    method: 'get',
    param
  })
}

// 订单新增
export function addOrder(data) {
  return request({
    url: '/order/order/add',
    method: 'post',
    data
  })
}

// 订单修改
export function updateOrder(data) {
  return request({
    url: '/order/order/update',
    method: 'put',
    data
  })
}

// 订单详情
export function detailOrder(params) {
  return request({
    url: '/order/order/detail',
    method: 'get',
    params
  })
}

// 作废订单
export function cancelOrder(data) {
  return request({
    url: '/order/order/cancel',
    method: 'post',
    data
  })
}

// 复制生成订单
export function copyOrder(data) {
  return request({
    url: '/order/order/copy',
    method: 'post',
    data
  })
}

// 生成红字订单
export function createRedOrder(data) {
  return request({
    url: '/order/order/red/create',
    method: 'post',
    data
  })
}

// 审核订单
export function checkOrder(data) {
  return request({
    url: '/order/order/check',
    method: 'post',
    data
  })
}

// 回款审核
export function syncOrder(data) {
  return request({
    url: '/order/collect/amount/sync',
    method: 'post',
    data
  })
}

export function importOrderBranch(data) {
  return request({
    url: '/order/order/import',
    method: 'post',
    data
  })
}
